package IO.g4;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class InputStream {

	public void byteRead() throws IOException {
		File f = new File("bin/bla.txt");
		byte[] buffer = new byte[(int) f.length()];
		FileInputStream in = new FileInputStream(f);
		in.read(buffer);
		in.close();
	}

	public void characterRead() throws IOException {
		Reader reader = null;
		reader = new FileReader("FileWriter.txt");
		int c = 0;
		while (c != -1) {
			c = reader.read();
			System.out.print((char) c);
		}
		reader.close();
	}
	
	public static void main(String[] args) throws IOException {
		new InputStream().characterRead();
	}
}
